package org.dong.control;

import org.dong.pojo.Dto;
import org.dong.pojo.Subject;
import org.dong.service.SubjectService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class SubjectControl {
    @Resource
    private SubjectService subjectService;
    @GetMapping("/Subject/GetList")
    public Dto getSubjectList(){
        Dto dto = new Dto();
        List<Subject> subjectList = subjectService.getSubjectList();
        Map<String, Object> datas = new HashMap<String, Object>();
        datas.put("list", subjectList);
        dto.setDatas(datas);
        dto.setErrMsg("科室列表");
        dto.setStatusCode(200);
        return dto;

    }
}
